﻿
namespace LogikBug.Async.Tasks.Entities
{
	public abstract class Model
	{
	}

	public abstract class Model<T> : Model, IAgentModel
	{
		#region Constructors

		protected Model(T entity)
		{
			Entity = entity;
		}

		#endregion

		#region Properties

		public virtual T Entity { get; set; }

		#endregion

		#region Methods

		#region IAgentModel Members

		public virtual TType GetModel<TType>()
		{
			if (ModelIs<TType>())
			{
				object obj = Entity;
				return (TType)obj;
			}

			return default(TType);
		}

		public bool ModelIs<TType>()
		{
			return Entity is TType;
		}

		#endregion

		#endregion
	}
}
